package org.glut.wechat.videochat.domain;

import lombok.Data;

import java.util.Map;

@Data
public class SignalingMessage {
    /**
     * 消息类型：
     * offer - 发起方发送的SDP offer
     * answer - 接收方回复的SDP answer
     * candidate - ICE候选信息
     * join - 加入房间
     * leave - 离开房间
     * invite - 发起邀请
     * invitation - 接收邀请通知
     * accept - 接受邀请
     * reject - 拒绝邀请
     */
    private String type;

    private String roomId;  // 房间ID，用于标识通话房间

    private String senderId;  // 发送者用户ID

    private String targetUserId; // 目标用户ID

    private String callType;

    /**
     * 消息数据：
     * 对于offer/answer类型：存储RTCSessionDescription
     * 对于candidate类型：存储RTCIceCandidate
     */
    private Map<String, Object> data;

    public String getTargetUserId() {
        return (String) data.get("targetUserId");
    }

    public String getCallType() {
        return (String) data.get("callType");
    }
}
